#ifndef GLOBAL_H
#define GLOBAL_H

#include <QMutex>
#include <QWaitCondition>
#include <QStringList>
#include <QSqlRecord>
#include <QList>
#include <QReadWriteLock>

#define CLIENT_STUDY_DB "jfclient.db"

#define DCM_PASS_SUFFIX_LIST_FILE "etc/passsuffix.ini"
#define DCM_DENY_SUFFIX_LIST_FILE "etc/denysuffix.ini"
#define DCM_SCAN_DIR_LIST_FILE "etc/dirs.ini"

#define SQLITE_DB_NAME "jfstudy.db"

#ifdef GLOBAL_CPP
#define GLOBAL_EXTERN
#else
#define GLOBAL_EXTERN extern
#endif

GLOBAL_EXTERN QMutex gVerifyMutex;
GLOBAL_EXTERN QMutex gParseMutex;
GLOBAL_EXTERN QMutex gFtpMutex;
GLOBAL_EXTERN QMutex gHttpMutex;
GLOBAL_EXTERN QReadWriteLock gDbLock;

GLOBAL_EXTERN QWaitCondition gVerifyCond;
GLOBAL_EXTERN QWaitCondition gParseCond;
GLOBAL_EXTERN QWaitCondition gFtpCond;
GLOBAL_EXTERN QWaitCondition gHttpCond;

GLOBAL_EXTERN QStringList gVerifyList;
GLOBAL_EXTERN QStringList gParseList;
GLOBAL_EXTERN QList<QSqlRecord> gFtpList;
GLOBAL_EXTERN QList<QSqlRecord> gHttpList;

GLOBAL_EXTERN void MessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg);

#endif // GLOBAL_H
